/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * leafget
 * Copyright (C) xinliGG 2008 <xinliGG@gmail.com>
 * 
 * leafget is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * leafget is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _FTP_H_
#define _FTP_H_

#include "leafget.h"
#include "socket.h"
 
class Ftp: private Socket 
{
public:
	Ftp(void);
	virtual ~Ftp(void){};
			
		/* initial functions */
	
	const bool configure      ( const std::string &, const int & );
	const bool user_conf      ( const std::string &, const std::string & );
	
		/* set functions*/

	const bool set_type       ( const bool & );
		
	const bool set_stop       ( void );

	const bool set_speedLimit ( const int & );

		/* get functions */

	const long get_size       ( const std::string & );
	const bool get_file       ( LEAF_TASK_DATA *, const std::string, const std::string, const int, const bool );

		/* final functions */

	const bool quit           ( void );	
	
private:

		/* initial functions */

	const bool  pasv_mode  ( std::string &, int & );
	Socket * open_pasv  ( const std::string &, const int & );

	const bool  rest       ( const int & );
	const bool  retr       ( const std::string & );

		/* get functions */

	const std::string get_cod    ( int & );

		/* final functions */

	const bool  abort      ( void );

		/* active functions */

	const bool active_speedLimit ( const int &, const int &, const int & );

	std::string user;
	std::string pass;
 
	bool start;

	int speedLimit;
};


#endif // _FTP_H_
